<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>识别模型添加</title>
<link    th:href="@{../../layui/css/layui.css}" rel="stylesheet" />
<link    th:href="@{../../webupload/webuploader.css}" rel="stylesheet" />
<script th:src="@{../js/jquery-1.8.2.min.js}"></script>
<script  th:src="@{../../webupload/webuploader.js}"></script>
<script  th:src="@{../../webupload/upload.js}"></script>
</head>
<body>
	<div th:include="header :: right"></div> 
	<div class="layui-body">
    <ul style="padding: 53px 4px;" class="layui-tab-title">
      <li ><a th:href="@{/model/list}">模型列表</a></li>
      <li class="layui-this">识别模型添加</li>
    </ul>
    <!-- 内容主体区域 -->
    <div style="padding: 53px 4px;"  >
	   <form class="layui-form" action="/model/save" method="post"  enctype="multipart/form-data">
	   	<input type="text" hidden="hidden" name="modelId" th:value="${models.modelId}"/>
 	 	<input type="text" hidden="hidden" id="fileName" name="modelDescription" /> 
		  <div class="layui-form-item">
		    <label class="layui-form-label">模型名：</label>
		    <div class="layui-input-inline">
		      <!-- <button type="button" class="layui-btn" id=""><i class="layui-icon"></i>上传文件</button> -->
		      <input name="modelName" lay-verify="title"  autocomplete="off" placeholder="请输入模型名" class="layui-input" th:value="${models.modelName}" type="text"/>
		    </div>
		  </div>
		  <span th:unless="${ #lists.isEmpty(models.modelPath)}"> 
			  	<div class="layui-form-item">
			    <label class="layui-form-label">模型路径：</label>
			    <div class="layui-input-inline">
			      <input id="docUrl" name="modelPath" lay-verify="title"  autocomplete="off" placeholder="请输入模型路径" th:value="${models.modelPath}" class="layui-input" type="text"/>
			    </div>
			  </div>
		  </span>
		   <span th:if="${ #lists.isEmpty(models.modelPath)}"> 
			      <input id="docUrl" name="modelPath" hidden="hidden"  type="text"/>
		  </span>
		  
		  
		   <div class="layui-form-item">
		    <label class="layui-form-label">模型类别：</label>
		    <div class="layui-input-inline">
		    	<select name="modelType" lay-filter="aihao">
			        <option value=""></option>
			        <span th:if="${'1' eq models.modelType}" > 
			        	<option value="0" >场景</option>
			        	<option value="1" selected="selected">视频</option>
			        </span>
			        <span th:unless="${'1' eq models.modelType}" > 
			        	<option value="0" selected="selected">场景</option>
			        	<option value="1" >视频</option>
			        </span>
			     </select>
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">模型描述文件：</label>
		    <div class="layui-input-inline">
		      <!-- <button type="button" class="layui-btn" id=""><i class="layui-icon"></i>上传文件</button> -->
		      
		     <span th:if="${ #lists.isEmpty(models.modelDescription)}"> 
		     	<!-- <input name="file" lay-verify="title"  autocomplete="off" placeholder="请输入文件名称" class="layui-input" th:value="${models.modelDescription}" type="file"/> -->
			    <div id="uploader" class="wu-example">
			    <!--用来存放文件信息-->
					    <div id="thelist" class="uploader-list"></div>
					    <div class="btns">
					        <div id="picker">选择文件</div>
					        <!-- <button id="ctlBtn" class="btn btn-default">开始上传</button> -->
					    </div>
				</div>
		    </span>
		    <span th:unless="${ #lists.isEmpty(models.modelDescription)}">
		    	<a th:href="${'/task/download?modelDescription='+models.modelDescription}" th:text="${models.modelDescription}">下载</a>
		    </span>
		    </div>
		  </div>
		  
		  
		   <div class="layui-form-item">
		    <div class="layui-input-block">
		    
		    <span th:if="${ #lists.isEmpty(view)}"> 
		      <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
		     </span>
		      <button type="reset" class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
		    </div>
		  </div>
	  </form>
    </div>
  </div>
  
  <div class="layui-footer">
    © layui.com - 底部固定区域
  </div>
  <script th:src="@{../../layui/layui.js}"></script>
<script>
//JavaScript代码区域
layui.use('element', function(){
  var element = layui.element;
  
});

layui.use('form', function(){
	  var form = layui.form;
	  
	  //各种基于事件的操作，下面会有进一步介绍
	});
</script>	
	 
</body>
</html>